var forum = {
    vueInfo: null,
    URL: {},
    detail: {
        getUserForum: function () {
            $.post(info.URL.getUserInfoUrl, {}, function (data) {
                if (!data.hasError) {
                    forum.vueInfo = new Vue({
                        el: "#all",
                        data: {
                            userInfo: data.object,
                            forumNum: data.object.forumNum == null ? "" : data.object.forumNum,
                        },
                        mounted: function () {
                            winInit();
                            $.pop.load(false, null);
                        },
                        methods: {
                            saveInfo: function () {
                                var vmObj = this;
                                forum.detail.saveUserForum(vmObj);
                            }
                        }
                    });
                } else {
                    if (data.errType != null) {
                        $.pop.tips(data.error);
                        if (data.errType == "NOSESSION") {
                            setTimeout(function () {
                                window.location.href = data.errUrl;
                                return false;
                            }, 400);
                        }
                    }
                }
            }, "json").error(function (XMLHttpRequest, textStatus, errorThrown) {
                $.pop.load(false, null);
                $.pop.tips("系统繁忙，请稍后" + XMLHttpRequest.status + "," + XMLHttpRequest.readyState + "," + textStatus);
            });
        },
        saveUserForum: function (vmObj) {
            var forumNum = vmObj.forumNum;
            if (__JsUtil.isNullOrEmpty(forumNum)) {
                $.pop.tips("请选择分论坛");
                return false;
            }
            $.pop.load(true, "正在保存...");
            $.post(info.URL.saveUserInfoUrl, $("#myForm").serialize(), function (data) {
                if (!data.hasError) {
                    window.location.href = 'info_yes.html';
                    $.pop.load(false, null);
                } else {
                    $.pop.tips(data.error);
                    if (data.errType != null) {
                        if (data.errType == "NOSESSION") {
                            setTimeout(function () {
                                window.location.href = data.errUrl;
                                return false;
                            }, 400);
                        }
                    }
                }
            }, "json").error(function (XMLHttpRequest, textStatus, errorThrown) {
                $.pop.load(false, null);
                $.pop.tips("系统繁忙，请稍后" + XMLHttpRequest.status + "," + XMLHttpRequest.readyState + "," + textStatus);
            });
        }
    }
}